package org.red.math;

public class Circle {
	private float _x;
	private float _y;
	private float _radius;
	
	public Circle(float _x, float _y, float _radius) {
		this._x = _x;
		this._y = _y;
		this._radius = _radius;
	}
	public boolean isCollision(Circle c) {
		float sum_rad = _radius + c.getRadius();
		float dx = _x - c.getX();
		float dy = _y - c.getY();
		if(dx * dx + dy * dy <= sum_rad * sum_rad) {
			return true;
		}
		return false;
	}
	public float getX() {
		return _x;
	}
	public void setX(float _x) {
		this._x = _x;
	}
	public float getY() {
		return _y;
	}
	public void setY(float _y) {
		this._y = _y;
	}
	public float getRadius() {
		return _radius;
	}
	public void setRadius(float _radius) {
		this._radius = _radius;
	}
	
}
